package com.example.qxfw.qxxx.mapper;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.qxfw.common.entity.qx.WaterStation;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;


import java.util.List;

@Mapper
@DS("qx")
public interface WaterStationMapper extends BaseMapper<WaterStation> {
    @Select("select stcd,stnm,lgtd,lttd " +
            "from water_station " +
            "where addvcd like '%${addvcd}%' and (sttp='PP' or sttp='MM') ")
    List<WaterStation> selectList1(String addvcd);

    @Select("select stcd " +
            "from water_station " +
            "where addvcd like '%${addvcd}%' and (sttp='PP' or sttp='MM') ")
    List<String> selectStcd(String addvcd);

    /**
     * 获取水文站信息
     * @param currentMonth 当前月份
     * @return
     */
    @Select("SELECT stcd, stnm, lgtd, lttd, stbk, stk, '' AS z , z${currentMonth} AS zm " +
            "FROM water_station " +
            "ORDER BY stcd")
    List<WaterStation> selectWaterStationInfo(@Param("currentMonth") int currentMonth);

}
